# encoding: utf-8
require './config/environment'

use Rack::Cors do
  allow do
    origins '*'
    resource '/*', :headers => :any, :methods => [:get, :post, :options, :put, :delete],
             :expose => %w(Content-Range Accept-Ranges), :credentials => true
  end
end


use Rack::Session::Cookie, :key => 'rack.session',
    :path => '/',
    :secret => $config['base']['secret_key']

# use Rack::TryStatic, :root => "#{__dir__}/web", :urls => %w[/], :try => %w(.html .js .css index.html .md)
map $config['base']['prefix'] do
  run App
end